﻿using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace Reckoning
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {            
            IUnityContainer container = new UnityContainer()
                .RegisterType<ICounter, Counter>()
                .RegisterType<ICountFilter, CountFilter>()
                .RegisterType<IFileDialogService, FileDialogService>()
                .RegisterType<IReferenceDataFile, ReferenceDataFile>()
                .RegisterType<IView, MainWindow>()
                .RegisterType<IStopWordsViewModel, StopWordsViewModel>();                                     
            
            var model = container.Resolve<MainViewModel>();
        }

        protected override void OnExit(ExitEventArgs e)
        {
            Reckoning.Properties.Settings.Default.Save();
            base.OnExit(e);
        }
    }
}
